package com.business.business.web.web;

import cn.hutool.json.JSONObject;
import com.business.business.common.base.BaseController;
import com.business.business.support.annotaion.Action;
import com.business.business.support.model.RespEntity;
import com.business.business.web.service.FiretrainingService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

@Action
@RequestMapping(value="/firetraining")
public class FiretrainingController extends BaseController {
    @Resource
    public FiretrainingService firetrainingService;
    @RequestMapping(value = "/firetrainingAdd",method = RequestMethod.POST)
    //前台传递的是json数据类型
    public RespEntity firetrainingAdd(@RequestBody(required = false) JSONObject jsonParam)  throws Exception{
        return firetrainingService.firetrainingAdd(jsonParam);
    }
    /**
     * @Author LiHaoDong
     * @Description 消防培训列表
     * @Date 15:05 2020/7/22
     * @Param [jsonParam]
     * @return com.business.business.support.model.RespEntity
     **/
    @RequestMapping(value = "/firetrainingListPage",method = RequestMethod.GET)
    public RespEntity firetrainingListPage(@RequestBody(required = false) JSONObject jsonParam) throws Exception{
        return firetrainingService.firetrainingListPage(jsonParam);
    }

    /**
     * @Author LiHaoDong
     * @Description 消防培训详情
     * @Date 15:35 2020/7/22
     * @Param [jsonParam]
     * @return com.business.business.support.model.RespEntity
     **/
    @RequestMapping(value = "/firetrainingDetail",method = RequestMethod.GET)
    public RespEntity firetrainingDetail(@RequestBody(required = false) JSONObject jsonParam) throws Exception{
        return firetrainingService.firetrainingDetail(jsonParam);
    }

    /**
     * @Author LiHaoDong
     * @Description 消防培训修改
     * @Date 15:44 2020/7/22
     * @Param [jsonParam]
     * @return com.business.business.support.model.RespEntity
     **/
    @RequestMapping(value = "/firetrainingUpdate",method = RequestMethod.POST)
    public RespEntity firetrainingUpdate(@RequestBody(required = false) JSONObject jsonParam) throws Exception{
        return firetrainingService.firetrainingUpdate(jsonParam);
    }

    /**
     * @Author LiHaoDong
     * @Description 消防培训删除
     * @Date 16:04 2020/7/22
     * @Param [jsonParam]
     * @return com.business.business.support.model.RespEntity
     **/
    @RequestMapping(value = "/firetrainingDelete",method = RequestMethod.POST)
    public RespEntity firetrainingDelete(@RequestBody(required = false) JSONObject jsonParam) throws Exception{
        return firetrainingService.firetrainingDelete(jsonParam);
    }
}
